import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
# 饼图标签
kinds = ['童装', '奶粉辅食', '孕妈专区', '洗护喂养', '宝宝尿裤',
         '春夏新品', '童车童床', '玩具文娱', '童鞋']
# 饼图的数据
sales = np.array([29665, 3135.4, 4292.4, 5240.9, 5543.4,
5633.8, 6414.5, 9308.1, 10353])
sales_total = np.sum(sales)
sales_scale = [i/sales_total for i in sales]
# 绘制饼图
plt.pie(sales_scale, labels=kinds, autopct='%3.1f%%')
plt.show()
